#include "sal.h"

#include "asw/include/drv_api.h"
#include "asw/include/drv_io.h"
#include "ctc_cli.h"
#include "ctc_cli_common.h"
#include "ctc_master_cli.h"
#include "dal.h"
#include "ctc_error.h"
#include "ctc_const.h"

CTC_CLI(ctc_cli_asw_common_show_ver,
        ctc_cli_asw_common_show_ver_cmd,
        "show version",
        CTC_CLI_SHOW_STR,
        "Sdk version")
{
    char chipname[20] = {0};
    uint32 dev_id = 0;

    dal_get_chip_dev_id(g_api_lchip, &dev_id);

    switch(dev_id)
    {
        case DAL_TSINGMA_AX_DEVICE_ID:
            sal_strcpy(chipname, "Tsingma.AX");
            break;

        default:
            return CTC_E_INVALID_PARAM;
            break;
    }
    ctc_cli_out("    SDK %s Released at %s. Chip Series: %s \n\
    Copyright (C) %s Centec Networks Inc.  All rights reserved.\n\
    Compile time: %s %s\n",
    CTC_SDK_VERSION_STR, CTC_SDK_RELEASE_DATE, chipname, CTC_SDK_COPYRIGHT_TIME,__DATE__,__TIME__);

    return CLI_SUCCESS;
}
int32
ctc_asw_cli_init(uint8 cli_tree_mode)
{
    install_element(cli_tree_mode, &ctc_cli_asw_common_show_ver_cmd);
    return CLI_SUCCESS;
}

int32
ctc_asw_chip_special_cli_init(void)
{
    ctc_asw_cli_init(CTC_ASW_MODE);
    ctc_asw_port_cli_init(CTC_ASW_MODE);
    ctc_asw_vlan_cli_init(CTC_ASW_MODE);
    ctc_asw_acl_cli_init(CTC_ASW_MODE);
    ctc_asw_linkagg_cli_init(CTC_ASW_MODE);
    ctc_asw_l2_cli_init(CTC_ASW_MODE);
    ctc_asw_qos_cli_init(CTC_ASW_MODE);
    ctc_asw_security_cli_init(CTC_ASW_MODE);
    ctc_asw_chip_cli_init(CTC_ASW_MODE);
    ctc_asw_mirror_cli_init(CTC_ASW_MODE);
    ctc_asw_stats_cli_init(CTC_ASW_MODE);
    ctc_asw_pdu_cli_init(CTC_ASW_MODE);
    ctc_asw_learning_aging_cli_init(CTC_ASW_MODE);
    ctc_asw_ipmc_cli_init(CTC_ASW_MODE);
    ctc_asw_parser_cli_init(CTC_ASW_MODE);
#if (FEATURE_MODE == 0)
    ctc_asw_sync_ether_cli_init(CTC_ASW_MODE);
#endif
    ctc_asw_diag_cli_init(CTC_ASW_MODE);
    return CLI_SUCCESS;
}
